<template>
	<ui-page :fixed-header="true">
    <view style="width: 100%;text-align: center">
      <image :src="indexLogoImage" style="width: 100%;height: 1050rpx"  ></image>
      <image :src="indexErweimaImage" style="width: 100%;height: 350rpx"    :show-menu-by-longpress="true" alt="" srcset=""></image>
      <view class="publish-box"  @click="handleVehicleCreateClick">
          <view class="publish-box-fast" >快速发布</view>
      </view>
    </view>
		<view class="analysis__tips"  @click="handleVehicleCreateClick">
      <image :src="indexAddImage" style="width: 140rpx;height: 165rpx;float: right"></image>
    </view>
	</ui-page>
</template>

<script>
	import { mapGetters } from 'vuex'
	import { getShareData } from '@/utils/share.js'
	import { getLast7days} from '@/utils/date.js'
	import BiFollowOfficialAccount from '@/common/follow-official-account/follow-official-account.vue';
	function randomRange(min, max) {
	    return Math.floor(Math.random() * (max - min)) + min;
	}
	export default {
		components: {
			BiFollowOfficialAccount
		},
		data() {
			return {
        indexLogoImage: 'https://hsmw-tool-pic-1303885219.cos.ap-beijing.myqcloud.com/weapp/files/htn/xuanchuan1.png',
        indexErweimaImage: 'https://hsmw-tool-pic-1303885219.cos.ap-beijing.myqcloud.com/weapp/files/htn/erweima.png',
        indexAddImage: 'https://hsmw-tool-pic-1303885219.cos.ap-beijing.myqcloud.com/weapp/files/htn/add1234.png',
        filters: {
					type: '1'
				},
				monthCountDate: new Date(),
				yearCountDate: new Date(),
				customCountDate: getLast7days(),
				currentCarType: '1',
				barWidth: 3,
				overviewCountData: {},
				selfCarCountData: [],
				rentalCarCountData: [],
				checkFlag:true,
			}
		},
		computed: {
			...mapGetters([
				'pagePopupActive'
			]),
      ...mapGetters(['isLogin']),
      typeItems () {
				return [{
					label: '月数据',
					name: '1'
				}, {
					label: '年数据',
					name: '2'
				}, {
					label: '自定义',
					name: '3'
				}]
			},
			carTypeItems () {
				return [{
					label: '自有车',
					name: '1'
				}, {
					label: '外租车',
					name: '2'
				}]
			}
		},
		onLoad() {
		},
		onShareAppMessage () {
			return getShareData()
		},
		methods: {
      previewImage() {
				uni.previewImage({
					// 需要预览的图片链接列表。若无需预览，可以注释urls
					urls: [this.indexErweimaImage],
					// 为当前显示图片的链接/索引值
					current: this.indexErweimaImage,
					// 图片指示器样式
					indicator: 'default',
					// 是否可循环预览
					loop: false,
					success: res => {
						console.log('previewImage res', res);
					},
					fail: err => {
						console.log('previewImage err', err);
					}
				});
			},
      handleVehicleCreateClick () {
        uni.navigateTo({
          url: '/packages/mine/sell/sell-create'
        });
			},
		}
	}
</script>

<style lang="less">
.analysis__overview{
	margin: 16px;
}
.analysis__month-picker,
.analysis__year-picker{
	margin: 12px 0;
}
.analysis__custom-picker{
	margin: 12px 16px;
}
.analysis__result-item{
	margin: 16px;
}
.anaysis__result-tabs{
	margin: 16px;
}
.analysis__result-card{
	display: flex;
	flex-direction: row;
	justify-content: space-between;
	align-items: center;
}
.analysis__result-card-chart{
	width: 180px;
	height: 120px;
}
.analysis__type{
	position: fixed;
	/*  #ifdef  H5  */
	position: absolute;
	/*  #endif  */
	left: 0;
	top: 0;
	width: 100%;
	box-sizing: border-box;
	z-index: 100;
	background-color: #ffffff;
	border-bottom: 1px solid #f3f3f3;
	padding: 8px 12px;
}

.analysis__tips {
	position: fixed;
	bottom: 20rpx;
	left: 0;
	right: 5rpx;
	padding: 8px 10px;
}
.publish-box{
  border-radius: 20rpx;
  margin: 15rpx;
  width: 100%;
  height: 120rpx;
  background-color: #F3E3A1;
  text-align: center;
  padding-top: 15rpx;
}
.publish-box-self{
  padding-top: 20rpx;
  border-radius: 20rpx;
  height: 50rpx;
  background-color: #F47554;
  margin-left:120rpx ;
  margin-right:120rpx ;
  color: white;
}
.publish-box-fast{
  margin-top: 10rpx;
  text-align: center;
  padding-top: 30rpx;
  border-radius: 20rpx;
  height: 70rpx;
  background-color: #F47554;
  margin-left:180rpx ;
  margin-right:180rpx ;
  color: white;
  font-size: 35rpx;
  font-weight: bold;
}
</style>
